-
-
Couldn't load subscription status.
- Fork 964
Fix capacity overflow in offset path node #3308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix capacity overflow in offset path node #3308
Conversation
|
I don't love lowering of the accuracy, is that a necessary change? |
…m/ashishmohapatra240/Graphite into fix/offset-path-capacity-overflow
|
i initially relaxed the accuracy from 1e-3 to 1e-2 thinking it would reduce recursion depth in fit_to_bezpath, reverted to 1e-3. |
|
Hey, @TrueDoctor Let me know if this works! |
|
simplified with |
| let is_degenerate = | ||
| (cubic_bez.p1 - start).hypot() < MAX_ABSOLUTE_DIFFERENCE && (cubic_bez.p2 - start).hypot() < MAX_ABSOLUTE_DIFFERENCE && (cubic_bez.p3 - start).hypot() < MAX_ABSOLUTE_DIFFERENCE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a quick comment about when this is true and why we return None in those cases? Also could you use start.distance(cubic_bez.p1) instead to make this more readable? If we introduced a squared constant, we could also use start.distance_squared(cubic_bez.p1) which would avoid the cost of computing the square root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comment explaining degenerate curves and switched to distance_squared(), please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, looking good!
Fixes #3288
Prevents infinite recursion in
fit_to_bezpathby:Graphite.mp4